import "core-js/features/string/replace-all.js";
import { JSDOM } from "jsdom";
import { createRequire } from "module";
import fetch from "node-fetch";
import path from "path";
import process from "process";
//@ts-ignore
import "regenerator-runtime/runtime.js";
import { fileURLToPath } from "url";
import { defaultconfig } from "../src/defaultconfig";
// import { htmltoelement } from "../src/htmltoelement";
import "./btoa-atob.cjs";
import { createprerenderplugin } from "./createprerenderplugin";
import { getmenulist } from "./getmenulist";
import { onlistenstart } from "./onlistenstart";
import { startall } from "./startall";
const require = createRequire(import.meta.url);
Reflect.set(global, "require", require);

// import { getlocalpathfrombaseurl } from "./getlocalpathfrombaseurl";
//@ts-ignore

const dom = new JSDOM(``, {});
Reflect.set(global, "window", dom.window);
Reflect.set(global, "document", dom.window.document);
Reflect.set(global, "fetch", fetch);

console.log(defaultconfig);
process.on("unhandledRejection", (e) => {
    throw e;
});

export var __dirname = path.resolve(
    path.dirname(fileURLToPath(import.meta.url))
);

// start();
export { startall };
export { createprerenderplugin };
export { getmenulist };
export { onlistenstart };
